package com.tensquare.qa.client;

import entity.Result;
import entity.StatusCode;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

//备用方案:为远程调用的接口提供实现类即可,将备用方案代码写到接口实现方法中
@Component
public class LabelClientImpl implements LabelClient {

    /**
     * 查  根据ID查询label
     * 如果远程调用失败,熔断器启动,远程调用会使用该方法代替远程调用
     */
    @RequestMapping(value = "/label/{labelId}", method = RequestMethod.GET)
    public Result findById(String labelId) {
        return new Result(true, StatusCode.OK,"熔断器备用方案启动!");
    }
}
